package com.translate.web.api.controller;

import com.translate.entity.ServiceType;
import com.translate.web.api.util.AjaxResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import com.translate.web.service.IServiceTypeService;

@RestController
@RequestMapping("serviceType")
@Slf4j
public class ServiceTypeController {
	private IServiceTypeService service;

	public ServiceTypeController(IServiceTypeService service) {
		this.service = service;
	}

	/**
	 * 获取服务类型信息
	 * @param serviceType
	 * @return
	 */
	@PostMapping("/getServiceTypeMessage")
	public AjaxResult getServiceTypeMessage(@RequestBody ServiceType serviceType) {
		AjaxResult ajaxResult = new AjaxResult();
		ServiceType serviceTypeMessage = this.service.getServiceTypeMessage(serviceType);
		ajaxResult.put("resultCode", 200);
		ajaxResult.put("message", "查询成功");
		ajaxResult.put("data", serviceTypeMessage);
		return ajaxResult;
	}
}
